<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/webCommon/webCommon.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>文件修改</title>
<!-- 默认选中班级名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".classIdSelect").each(function(){//循环获取所有单位编号 
			var classId = $(this).attr("value");
			var fileClassId = $("#sysFileClassId").attr("value");
			if(classId == fileClassId){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中班级名称-结束 -->
<!-- 默认选中组名名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".studentGroupSelect").each(function(){//循环获取所有单位编号 
			var studentGroupId = $(this).attr("value");
			var studentGroup = $("#sysFileStudentGroupId").attr("value");
			if(studentGroupId == studentGroup){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中组名名称-结束 -->
<script type="text/javascript" src="plugins/layui/layui.js"></script>
		<script>
			layui.use(['form', 'layedit', 'laydate'], function() {
				var form = layui.form(),
					layer = layui.layer,
					layedit = layui.layedit,
					laydate = layui.laydate;
				 //监听提交
				form.on('submit(tijiao)', function(data) {
					layer.alert(JSON.stringify(data.field), {
						title: '最终的提交信息'
					})
				});
			});
		</script>

</head>

<body>
	<div class="place">
	    <span>位置：</span>
	    <ul class="placeul">
	    <li><a href="#">首页</a></li>
	    <li><a href="#">系统管理</a></li>
	    <li><a href="#">修改专业信息</a></li>
	    </ul>
	    </div>
	    
	<div style="margin: 15px;">
		 <form class="layui-form" action="<%=basePath%>/sys/SysFile_edit.action">
		 <input name="id"  type="hidden" value="${sysFile.id}">
		 <input name="fileId"  type="hidden" value="${sysFile.fileId}">
		 
		<div class="layui-form-item">
					<label class="layui-form-label">所属产品-班别</label>
					<div class="layui-input-inline">
						<select name="classId" id="classId">
							<option value="">请选择...</option>
							<s:iterator value="sysClassAllList">
							<option class="classIdSelect" value="${classId}" id="${classId}">${className}</option>
							</s:iterator>
						</select>
					</div>
		 </div>
		 <div class="layui-form-item">
					<label class="layui-form-label">所属分类-组名</label>
					<div class="layui-input-inline">
						<select name="studentGroupId" id="studentGroupId">
							<option value="">请选择...</option>
							<s:iterator value="serviceStudentGroupAllList">
							<option class="studentGroupSelect" value="${studentGroupId}" id="${studentGroupId}">${studentGroupName}</option>
							</s:iterator>
						</select>
					</div>
		 </div>
		  <div class="layui-form-item">
					<label class="layui-form-label">文件类型</label>
					<div class="layui-input-block">
					<input name="fileType" type="radio" value="0" title="文档"  <c:if test="${0 == sysFile.fileType}">checked="checked"</c:if>  />
					<input name="fileType" type="radio" value="1" title="作品"  <c:if test="${1 == sysFile.fileType}">checked="checked"</c:if>  />
					</div>
				</div>
			<div class="layui-form-item">
				<label class="layui-form-label">文档标题</label>
				<div class="layui-input-inline">
					<input type="text" name="fileName" lay-verify="fileName" value="${sysFile.fileName }" autocomplete="off" placeholder="文件标题" class="layui-input">
				</div>
			</div>
			<element>
				<div class="layui-form-item">
					<label class="layui-form-label">关键字</label>
					<div class="layui-input-inline">
						<input type="text" name="fileKey" lay-verify="fileKey" value="${sysFile.fileKey }" autocomplete="off" placeholder="关键字" class="layui-input">
					</div>
				</div>
			</element>
			<div class="layui-form-item">
				<label class="layui-form-label">文件简介</label>
				<div class="layui-input-inline">
					<input type="text" name="fileProfile" lay-verify="fileProfile" value="${sysFile.fileProfile }" autocomplete="off" placeholder="简介" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">附件</label>
				<div class="layui-input-inline">
					<input type="text" name="fileAddress" lay-verify="fileAddress" value="${sysFile.fileAddress }" autocomplete="off" placeholder="点击添加" class="layui-input">
				</div>
			</div>
			
			
			<div class="layui-form-item">
					<div class="layui-input-block">
						<button id="tijiao" class="layui-btn" lay-filter="tijiao" lay-submit="">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
			</div>
		</form>
		
		
		 <input name="sysFile.classId" type="hidden" id="sysFileClassId" value="${sysFile.classId}"/>  <!-- 用于下拉选择的读取-班别 -->
		 <input name="sysFile.studentGroupId" type="hidden" id="sysFileStudentGroupId" value="${sysFile.studentGroupId}"/>  <!-- 用于下拉选择的读取-组名 -->
	</div>
</body>
</html>
